Middle Element
The Middle Element reference form specifies the middle object of a particular class in a container.SYNTAX
middle classNamewhereclassName is the class identifier for the specified object.
EXAMPLES
middle word of paragraph 1 middle item of {1, "doughnut", 33}NOTES
AppleScript calculates the middle object with the expression((n + 1) div 2)
, wheren
is the number of objects anddiv
is the integer division operator. If there is an even number of objects in the container, the result is rounded down. For example, the middle word of a paragraph containing twenty words is the tenth word.